<?php
/**
 * Created by PhpStorm.
 * User: cong.ding
 * Date: 2017/10/10
 * Time: 16:46
 */

include_once("DBUtil.php");

$db =new DBUtil();

$result=["result"=>"","message"=>""];
$data =[
  "type_name"=>$_POST['type_name']
];
$result_id =$db->insert("type_mst",$data);
if (!isset($result_id)||empty($result_id)) {
  $result["result"]=false;
  $result["message"]= mysqli_error($db);
} else {
  $result["result"]=true;
}
echo json_encode(["data"=>$result]);